extends Node

@export var enemies: Dictionary[String, PackedScene]

var enemy_pool: Dictionary[String, EnemyPool] = {}

func _ready() -> void:
	for enemy_name in enemies.keys():
		var pool = EnemyPool.new()
		pool.init_pool(enemies[enemy_name], 200)
		enemy_pool[enemy_name] = pool

func get_enemy(enemy_type: String) -> Enemy_Impl:
	if enemy_pool.has(enemy_type):
		return enemy_pool[enemy_type].get_enemy()
	else:
		print("Enemy type not found in pool.")
		return null

func release_enemy(enemy_type: String, enemy: Enemy_Impl) -> void:
	if enemy_pool.has(enemy_type):
		enemy_pool[enemy_type].release_enemy(enemy)
	else:
		enemy.queue_free()
		print("Enemy type not found in pool.")
